<?php

declare( strict_types = 1 );

namespace App\Common\Model\Base\DataUnit;

use App\Common as com;
use App\Common\Model\Base\DataUnit as nameDataUnit;

class Option extends nameDataUnit\Base {

	/**
	 * @var array|null[]
	 */
	private array $_option = [
		'isCleanIncompleteData' => null, // 是否清理不完整的数据。[false][默认]
		'isGlogalCache' => null, // 是否开启全局缓存。[false][默认]
	];


	/**
	 * 获取"是否清理不完整的数据"
	 * @return bool [false][默认]
	 */
	public function getIsCleanIncompleteData():bool {
		// return $this->_option['isCleanIncompleteData'] ?? null;
		return $this->_option['isCleanIncompleteData'] ?? false;
	}

	/**
	 * 设置"是否清理不完整的数据"
	 * @param bool $isCleanIncompleteData
	 * @return $this
	 */
	public function setIsCleanIncompleteData( bool $isCleanIncompleteData = true ):self {
		$this->_option['isCleanIncompleteData'] = $isCleanIncompleteData;
		//
		return $this;
	}

	/**
	 * 获取"是否开启全局缓存"
	 * @return bool [false][默认]
	 */
	public function getIsGlogalCache():bool {
		return $this->_option['isGlogalCache'] ?? false;
	}

	/**
	 * 设置"是否开启全局缓存"
	 * @param bool $isGlogalCache
	 * @return $this
	 */
	public function setIsGlogalCache( bool $isGlogalCache = true ):self {
		$this->_option['isGlogalCache'] = $isGlogalCache;
		//
		return $this;
	}

}
